/* Notes

The descriptive statistics are based on version 4-0-0 of the TwinLife dataset. Access can be requested through GESIS here: https://search.gesis.org/research_data/ZA6701

The descriptive stats are only based on Wave 1 data, as are the twin models.

The Stata code for cleaning the dataset used in this file is available in the "cleaning for Table.do" file

*/

cd ""

* load wide data to not double count pairs
clear
insheet using twinlife_table1.csv, comma

/* sop labels
sop0100 - "Sports association or club"
sop0101 - "Choir/music or theatre group or similar"
sop0102 - "Church or religious group"
sop0103 - "Trade union/professional association/student council"
sop0104 - "Voluntary fire and rescue services/technical relief association THW/DLRG German Lifesaving Association etc."
sop0105 - "Local history association/Citizens association/Marksmen club"
sop0106 - "Political organization/party/citizens’ initiative"
*/

* Drop age category 0 as they're not analyzed in wave 1
keep if agecat>0 & agecat!=.

* recode sop so higher values are more involvement and rescale to 0 to 1
replace w1_sop0100_1=(4-w1_sop0100_1)/3
replace w1_sop0101_1=(4-w1_sop0101_1)/3
replace w1_sop0102_1=(4-w1_sop0102_1)/3
replace w1_sop0103_1=(4-w1_sop0103_1)/3
replace w1_sop0104_1=(4-w1_sop0104_1)/3
replace w1_sop0105_1=(4-w1_sop0105_1)/3
replace w1_sop0106_1=(4-w1_sop0106_1)/3
replace w1_sop0100_2=(4-w1_sop0100_2)/3
replace w1_sop0101_2=(4-w1_sop0101_2)/3
replace w1_sop0102_2=(4-w1_sop0102_2)/3
replace w1_sop0103_2=(4-w1_sop0103_2)/3
replace w1_sop0104_2=(4-w1_sop0104_2)/3
replace w1_sop0105_2=(4-w1_sop0105_2)/3
replace w1_sop0106_2=(4-w1_sop0106_2)/3

replace w1_interest_1 = (w1_interest_1-1)/3
replace w1_interest_2 = (w1_interest_2-1)/3

replace w1_m_interest = (w1_m_interest-1)/3
replace w1_f_interest = (w1_f_interest-1)/3

replace w1_selfesteem_1 = (w1_selfesteem_1-1)/4
replace w1_selfesteem_2 = (w1_selfesteem_2-1)/4

* Parental interest by sex and age
sum w1_m_interest
ttest w1_m_interest if agecat==1, by(sex)
ttest w1_m_interest if agecat==2, by(sex)
ttest w1_m_interest if agecat==3, by(sex)

sum w1_f_interest
ttest w1_f_interest if agecat==1, by(sex)
ttest w1_f_interest if agecat==2, by(sex)
ttest w1_f_interest if agecat==3, by(sex)

* Self-esteem by sex and age
sum w1_selfesteem_1
*ttest w1_selfesteem_1 if agecat==1, by(sex) /* no observations */
ttest w1_selfesteem_1 if agecat==2, by(sex)
ttest w1_selfesteem_1 if agecat==3, by(sex)

* Group memberships

sum w1_sop010*_1

ttest w1_sop0100_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0100_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0100_1 if agecat==2, by(sex)
ttest w1_sop0100_1 if agecat==3, by(sex)

ttest w1_sop0101_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0101_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0101_1 if agecat==2, by(sex)
ttest w1_sop0101_1 if agecat==3, by(sex)

ttest w1_sop0102_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0102_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0102_1 if agecat==2, by(sex)
ttest w1_sop0102_1 if agecat==3, by(sex)

ttest w1_sop0103_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0103_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0103_1 if agecat==2, by(sex)
ttest w1_sop0103_1 if agecat==3, by(sex)

ttest w1_sop0104_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0104_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0104_1 if agecat==2, by(sex)
ttest w1_sop0104_1 if agecat==3, by(sex)

ttest w1_sop0105_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0105_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0105_1 if agecat==2, by(sex)
ttest w1_sop0105_1 if agecat==3, by(sex)

ttest w1_sop0106_1 if agecat>0 & agecat!=., by(sex)
*ttest w1_sop0106_1 if agecat==1, by(sex) /* not measured until age 16, even though the codebook says 10 */
ttest w1_sop0106_1 if agecat==2, by(sex)
ttest w1_sop0106_1 if agecat==3, by(sex)
